package reu.model;

import java.util.LinkedList;

public class Entry {

	private String firstName;
	private String midName;
	private String lastName;
	private String nameLink;
	public LinkedList<String> info;
	public LinkedList<String> infoLink;
	
	public Entry(String fname, String mname, String lname){
		this.setFirstName(fname);
		this.setMidName(mname);
		this.setLastName(lname);
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getMidName() {
		return midName;
	}

	public void setMidName(String midName) {
		this.midName = midName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName.toLowerCase();
	}
	
	public int compare(Entry e){
		String str1 = this.getLastName();
		String str2 = e.getLastName();
		int ret = 0;
		ret = str1.compareToIgnoreCase(str2);
		if(ret == 0){
			ret = this.getFirstName().compareToIgnoreCase(e.getFirstName());
			if(ret == 0){
				ret = this.getMidName().compareToIgnoreCase(e.getMidName());
			}
		}
		return ret;
	}

	public String getNameLink() {
		return nameLink;
	}

	public void setNameLink(String nameLink) {
		this.nameLink = nameLink;
	}
}
